reftests: Add an inscription xalign RTL test
authorBenjamin Otte <otte@redhat.com>
Mon, 13 Jun 2022 03:30:08 +0000 (05:30 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 13 Jun 2022 04:49:22 +0000 (06:49 +0200)
This checks mainly that we do the right thing wrt PangoAlignment
weirdness.

0.25 and 0.75 are set to 0.0 and 1.0 currently because of Pango
limitations (and no desire to manually move lines).
But if that were to be fixed, both the ref and the test should update in
the same way and things should just keep working.

testsuite/reftests/inscription-xalign-rtl.ref.ui [new file with mode: 0644]
testsuite/reftests/inscription-xalign-rtl.ui [new file with mode: 0644]
testsuite/reftests/meson.build

diff --git a/testsuite/reftests/inscription-xalign-rtl.ref.ui b/testsuite/reftests/inscription-xalign-rtl.ref.ui
new file mode 100644 (file)
index 0000000..5d31f89
--- /dev/null
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <object class="GtkWindow">
+    <property name="default-width">200</property>
+    <property name="decorated">0</property>
+    <child>
+      <object class="GtkBox">
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkInscription">
+            <property name="text">עִברִית
+English</property>
+            <property name="min-lines">2</property>
+            <property name="xalign">0.0</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkInscription">
+            <property name="text">עִברִית
+English</property>
+            <property name="min-lines">2</property>
+            <property name="xalign">0.25</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkInscription">
+            <property name="text">עִברִית
+English</property>
+            <property name="min-lines">2</property>
+            <property name="xalign">0.5</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkInscription">
+            <property name="text">עִברִית
+English</property>
+            <property name="min-lines">2</property>
+            <property name="xalign">0.75</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkInscription">
+            <property name="text">עִברִית
+English</property>
+            <property name="min-lines">2</property>
+            <property name="xalign">1.0</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/reftests/inscription-xalign-rtl.ui b/testsuite/reftests/inscription-xalign-rtl.ui
new file mode 100644 (file)
index 0000000..a8e469f
--- /dev/null
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <object class="GtkWindow">
+    <property name="default-width">200</property>
+    <property name="decorated">0</property>
+    <child>
+      <object class="GtkBox">
+        <property name="orientation">vertical</property>
+        <signal name="map" handler="reftest:set_default_direction_rtl" swapped="no"/>
+        <signal name="destroy" handler="reftest:set_default_direction_ltr" swapped="no"/>
+        <child>
+          <object class="GtkInscription">
+            <property name="text">עִברִית
+English</property>
+            <property name="min-lines">2</property>
+            <property name="xalign">0.0</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkInscription">
+            <property name="text">עִברִית
+English</property>
+            <property name="min-lines">2</property>
+            <property name="xalign">0.25</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkInscription">
+            <property name="text">עִברִית
+English</property>
+            <property name="min-lines">2</property>
+            <property name="xalign">0.5</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkInscription">
+            <property name="text">עִברִית
+English</property>
+            <property name="min-lines">2</property>
+            <property name="xalign">0.75</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkInscription">
+            <property name="text">עִברִית
+English</property>
+            <property name="min-lines">2</property>
+            <property name="xalign">1.0</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
index 068f98b159b9de06edbebf1a8b4d20590fa20da2..25fb13ab0d066defef75520a5c3cd805013c10c6 100644 (file)
@@ -377,6 +377,8 @@ testdata = [
   'inscription-overflow-yalign.ui',
   'inscription-xalign.ref.ui',
   'inscription-xalign.ui',
+  'inscription-xalign-rtl.ref.ui',
+  'inscription-xalign-rtl.ui',
   'label-attribute-preference.css',
   'label-attribute-preference.ref.ui',
   'label-attribute-preference.ui',